async function a(){
  console.log(1)
  await b()
  console.log(2)
}

async function b(){
  console.log(3)
}

setTimeout(function(){
  console.log(4)
})

a()

new Promise(function(resolve,reject){
  console.log(5)
  resolve()
  console.log(6)
}).then(function(){
  console.log(7)
})

console.log(8)

// 1 3 5 6 8 7 2 4 